import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import indexView from "@/views/indexView";

Vue.use(VueRouter)

/*配置路由信息*/
const routes = [
  {
    path: '/sys-admin/index',
    name: 'home',
    redirect:'/sys-admin/index',
    component: HomeView,
    /*配置子集合路由信息*/
    children:[
      {
        path: '/sys-admin/index',
        component: () => import('../views/sys-admin/indexView')
      },
      {
        path: '/sys-admin/temp/examUser/addNew',
        component: () => import('../views/sys-admin/temp/ExamUserAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/examUser/list',
        component: () => import('../views/sys-admin/temp/ExamUserListView.vue')
      },
      {
        path: '/sys-admin/temp/examIntroduction/addNew',
        component: () => import('../views/sys-admin/temp/ExamIntroductionAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/examIntroduction/list',
        component: () => import('../views/sys-admin/temp/ExamIntroductionListView.vue')
      },
      {
        path: '/sys-admin/temp/exam/addNew',
        component: () => import('../views/sys-admin/temp/ExamAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/exam/list',
        component: () => import('../views/sys-admin/temp/ExamListView.vue')
      },


      {
        path: '/sys-admin/temp/feedback/list',
        component: () => import('../views/sys-admin/temp/FeedbackListView.vue')
      },
      {
        path: '/sys-admin/temp/info/addNew',
        component: () => import('../views/sys-admin/temp/InfoAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/info/list',
        component: () => import('../views/sys-admin/temp/InfoListView.vue')
      },
      {
        path: '/sys-admin/temp/user/addNew',
        component: () => import('../views/sys-admin/temp/UserAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/user/list',
        component: () => import('../views/sys-admin/temp/UserListView.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView.vue')
  },
  {
    path: '/reg',
    name: 'reg',
    component: () => import(/* webpackChunkName: "about" */ '../views/RegView')
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/',
    name: 'index',
    redirect:'/login',
    component:indexView,
    children: [
      {
        path: '/sys-index/index',
        component: () => import('../views/sys-index/indexView')
      },

      {
        path: '/sys-index/temp/apply',
        component: () => import('../views/sys-index/temp/ExamOnlineApplyView.vue')
      },
      {
        path: '/sys-index/temp/info',
        component: () => import('../views/sys-index/temp/ExamInfoView.vue')
      },
      {
        path: '/sys-index/temp/feedback',
        component: () => import('../views/sys-index/temp/ExamFeedbackView.vue')
      },
      {
        path: '/sys-index/temp/check',
        component: () => import('../views/sys-index/temp/ExamCheckResultsView.vue')
      },

    ]

  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
